<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Promise的链式调用</title>
</head>
<body>

<script>
    new Promise(((resolve, reject) => {
        setTimeout(() => {
            resolve("aaa")
            // reject("bbb")
        }, 2000)
    })).then((res) => {
        console.log(res, '第一层');
        return res + "111"
        // return Promise.reject(err + "222")
        // throw "error message"
    }).then(res => {
        console.log(res, "第二层");
        return res + "222"
    }).then(res => {
        console.log(res, "第三层");
        return res + "333"
    }).catch(err => {
        console.log(err);
    })
</script>

</body>
</html>